package com.pfzy.lib.net.lifecycle;

import io.reactivex.Observable;
import io.reactivex.subjects.BehaviorSubject;

public class LifeCycleObservable {
    private BehaviorSubject mBehaviorSubject;

    private LifeCycleObservable(BehaviorSubject observable) {
        this.mBehaviorSubject = observable;
    }

    public static LifeCycleObservable create() {
        return new LifeCycleObservable(BehaviorSubject.create());
    }

    public void finish() {
        this.mBehaviorSubject.onNext("finish");
    }

    public Observable get() {
        return this.mBehaviorSubject;
    }
}
